package push;

import helper.ImageData;
import helper.ImageProcessor;
import framework.filters.AbstractPushFilter;
import framework.pipes.PushPipe;

/**
 * Apply the threshold operation on the given image
 * 
 * @author Wetzel & Rusch
 * 
 */
public class ThresholdFilter extends AbstractPushFilter<ImageData> {

	double[] m_low;
	double[] m_high;
	double[] m_map;

	public ThresholdFilter(PushPipe<ImageData> pushPipe) {
		super(pushPipe);
	}

	public void setValues(double[] low, double[] high, double[] map) {
		m_low = low;
		m_high = high;
		m_map = map;
	}

	@Override
	public void doIt() {
		ImageProcessor ip = ImageProcessor.getInstance();
		m_data.setRoiImage(ip.getThreshold(m_data.getRoiImage(), m_low, m_high,
				m_map));
	}
}
